package com.bonc.modules.item.utils;

import java.util.Objects;

/**
 * @author jinlong
 * @date 2021/8/11
 */
public enum ChartDateTypeEnum {
    DAY("0"),

    MONTH("1"),

    QUARTER("2"),

    YEAR("3");

    private String code;

    ChartDateTypeEnum(String code) {
        this.code = code;
    }


    public static ChartDateTypeEnum getByCode(String code) {
        for (ChartDateTypeEnum type : values()) {
            if (Objects.equals(type.code, code)) {
                return type;
            }
        }
        return null;
    }
}
